package o;

import android.content.Context;
import android.os.AsyncTask;
import com.huawei.appgallery.packagemanager.api.bean.ManagerTask;
import o.cof.d;

public class cpm extends AsyncTask<Void, Void, Void> {
    private Context ˋ;
    private String ॱ;

    protected /* synthetic */ Object doInBackground(Object[] objArr) {
        return ॱ((Void[]) objArr);
    }

    private cpm(Context context, String str) {
        this.ˋ = context;
        this.ॱ = str;
    }

    public static void ˊ(Context context, String str) {
        new cpm(context, str).execute(new Void[0]);
    }

    protected Void ॱ(Void... voidArr) {
        String ˎ = ˎ(this.ॱ);
        if (this.ˋ.getPackageName().equals(ˎ)) {
            cpp.ˏ(this.ˋ, this.ॱ, 1, 0, 1, false);
        } else {
            cnu.ˏ.ˋ("DealTheTaskWhenInstalledByOther", "DealTheTaskWhenInstalled pkg :" + this.ॱ + ",other market install the app!:" + ˎ);
            d ˋ = new d().ˋ(this.ॱ);
            if (cop.ˊ != null) {
                ˋ.ॱ(cop.ˊ.ˎ());
            }
            ManagerTask ˏ = ManagerTask.ˏ(ˋ.ˎ());
            ˏ.ʽ = ˎ;
            cpf.ˋ(this.ˋ).ॱ(11, ˏ);
        }
        return null;
    }

    private String ˎ(String str) {
        try {
            return this.ˋ.getPackageManager().getInstallerPackageName(str);
        } catch (IllegalArgumentException e) {
            cnu.ˏ.ˊ("DealTheTaskWhenInstalledByOther", "can not find installer pkg." + str);
            return "";
        }
    }
}
